<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 集合
        const people=new Set();
        people.add('Wes');
        people.add('杨执信');
        people.add('塔塔开');
        people.add('杨执信');
        console.log(people);
        for(let person of people){
            console.log(person);
        }
        people.forEach(person=>{
            console.log(person);
        })
        const student = new Set(['塔塔开','试试看','ggo']);
        console.log(student);
        const dogs=new Map(); // map 数据结构 值-值对应。建名不限于字符串
        dogs.set('snicker',3);
        dogs.set('sjdkjf',2);
        dogs.set(1,1);


        // 一个数组里的东西不用下标，把下标的的值解出来
        // es6 解构

        dogs.forEach((dog,v)=>{
            console.log(dog,v);
        });
        
        for(let k of dogs){
            console.log(k[0],k[1]);
        }
        // es6 解构
        for(let [k,v] of dogs){
            console.log(k,v);
        }
        console.log(dogs);
    </script>
</body>
</html>